﻿using System;
using System.IO;

namespace QuickTest.Core.Compilation
{
    public class DirectoryUri
    {
        private readonly Uri uri;

        public DirectoryUri(string uriString)
            : this(new Uri(uriString))
        {
        }

        private DirectoryUri(Uri uri)
        {
            if (uri == null)
                throw new ArgumentNullException("uri");

            if (! uri.IsFile || Path.GetFileName(uri.AbsolutePath) != string.Empty)
                throw new ArgumentException("Uri must be a directory uri");

            this.uri = uri;
        }

        public string AbsolutePath
        {
            get { return uri.AbsolutePath; }
        }
    }
}